package com.cy2;

import java.util.ArrayList;
import java.util.Collections;

public class PokeDemo {
    public static void main(String[] args) {
        ArrayList<String> array = new ArrayList<>();
        String[] colors = {"♥", "♠", "♣", "♦"};
        String[] numbers = {"2", "2", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A"};

        for (String color : colors) {
            for (String number : numbers) {
                array.add(color + number);
            }
        }
        array.add("大王");
        array.add("小王");
        // System.out.println(array);
        Collections.shuffle(array);
        ArrayList<String> player1 = new ArrayList<>();
        ArrayList<String> player2 = new ArrayList<>();
        ArrayList<String> player3 = new ArrayList<>();
        ArrayList<String> dipoker = new ArrayList<>();
        for (int i = 0; i < array.size(); i++) {
            if (i >= array.size() - 3) {
                dipoker.add(array.get(i));
            } else if (i % 3 == 0) {
                player1.add(array.get(i));
            } else if (i % 3 == 1) {
                player2.add(array.get(i));

            } else {
                player3.add(array.get(i));
            }
        }
        looker("陈勇", player1);
        looker("袁湘", player2);
        looker("老婆", player3);
        looker("底牌", dipoker);

    }

    public static void looker(String name, ArrayList<String> pokers) {
        System.out.print(name + "的牌是：");
        System.out.print(pokers);
        System.out.println();

    }
}
